

import React from 'react';
import {
  Text,
  View,
  StyleSheet,
  Image,
  TouchableWithoutFeedback
} from 'react-native';
const Avator = (props) => {
  const callBack = () => {
    if (props.onPress) {
      props.onPress();
    } else {
      console.log("please set function 'onPress'")
    }
  }
  return (
    <TouchableWithoutFeedback onPress={() => { callBack() }}>
      <View>
        <Image
          style={{ width: 100, height: 100, borderRadius: 50 }}
          source={{ uri: props.uri || 'https://reactnative.dev/docs/assets/p_cat2.png' }} />
      </View>
    </TouchableWithoutFeedback>
  );
};

const styles = StyleSheet.create({

});

export default Avator;
